//
//  OMOrderSubmitBaseViewController.m
//  OMENGO_NEW
//
//  Created by 梁尚嘉 on 2017/5/16.
//  Copyright © 2017年 Kamfat. All rights reserved.
//

#import "OMOrderSubmitBaseViewController.h"

@interface OMOrderSubmitBaseViewController ()

@end

@implementation OMOrderSubmitBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(@0);
        make.top.equalTo(self.navigationBar.mas_bottom);
    }];

    UIView *footer = [UIView new];
    footer.backgroundColor = SM_whiteColor;
    [self.view addSubview:footer];
    [footer mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.tableView.mas_bottom);
        make.height.equalTo(@(SM_SIZE(130)));
        make.left.right.bottom.equalTo(@0);
    }];
    [footer addSubview:self.confirmButton];
    [self.confirmButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(@(SM_SIZE(20)));
        make.right.bottom.equalTo(@(SM_SIZE(-20)));
    }];
    UIView *line = [UIView new];
    line.backgroundColor = SM_naviShadowColor;
    [footer addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.equalTo(@0);
        make.height.equalTo(@(.5f));
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
- (UIButton *)confirmButton
{
    if (!_confirmButton) {
        _confirmButton = [UIButton new];
        [_confirmButton setTitle:@"提交" forState:UIControlStateNormal];
        [_confirmButton setTitleColor:SM_blackColor forState:UIControlStateNormal];
        [_confirmButton setBackgroundImage:[UIImage imageWithColor:SM_sangouColor] forState:UIControlStateNormal];
        [_confirmButton setBackgroundImage:[UIImage imageWithColor:RGBACOLOR(0, 0, 0, .26)] forState:UIControlStateDisabled];
        _confirmButton.titleLabel.font = SM_CFont(35);
        [_confirmButton addTarget:self action:@selector(submitAction:) forControlEvents:UIControlEventTouchUpInside];
        _confirmButton.layer.cornerRadius = 4.f;
        _confirmButton.clipsToBounds = true;
    }
    return _confirmButton;
}


- (void)submitAction:(UIButton *)sender
{
    [self backAction];
}
@end
